package com.zrrd.yunchmall.product.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

@Data
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("all")
//将当前实体类和ES中的索引关联
@Document(indexName = "t_product", createIndex = false)
public class TProduct {
    // 指定id属性，同时设置id的生成模式（策略）
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer pid;//主键

    private String pname;//商品名称

    private Double pprice;//商品价格

    private Integer stock;//库存
}
